#include <iostream>
#include <string.h>
using namespace std;
class MyString{
    private:
        char* buffer;
    public:
        MyString(const char* initString){
            if (initString!=NULL){
                buffer=new char[strlen(initString)+1];
                buffer=strcpy(buffer,initString);
            }   
        }
        ~MyString(){
            if (buffer!=NULL){
                delete[] buffer;
            }
        }
        int GetLen(){
            return strlen(buffer);
        }
        char* GetString(){
            return buffer;
        }
};

void UsingMyString(MyString myString){
    cout<<"buffer length="<<myString.GetLen()<<endl;
    cout<<"buffer content="<<myString.GetString()<<endl;
    return;
}


int main(){
    MyString sayHello=MyString("Hello World");
    UsingMyString(sayHello);
}

